'''
Created on 13/06/2009

@author: nirg
'''

from Queue import Queue
import time

class PatchedQueue(Queue):
    def __patched_task_done(self):
        pass    

    def __patched_join(self):
        while not self.empty():
            time.sleep(.1)

    def __init__(self, maxsize=0):
        Queue.__init__(self, maxsize)
        if not "task_done" in dir(Queue):
            self.task_done = self.__patched_task_done
        if not "join" in dir(Queue):
            self.join = self.__patched_join